<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:core="http://www.contact.core.com/contacts/core/ui"
      xmlns:contact="http://www.contact.contact.com/contacts/contact/ui"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:common="http://www.contact.common.com/contacts/ui">

<ui:component>
    <!--<h:form>-->

    <!--<h:panelGrid style="float:left" columns="2">-->

    <h:panelGroup id="myContactCardViewPanel" style="height:auto; width:100%;" layout="block">
        <h:panelGroup style="float:left;vertical-align:top;" layout="block">
            <!--<contact:contactPicture/>-->
            <contact:myPictureCommand/>
        </h:panelGroup>
        <h:panelGroup style="float:left; text-align:left;  margin-left:10px; " layout="block">
            <h:panelGrid columns="1">
                <h:outputLabel value="#{accountSessionBean.account.firstName}
                     #{accountSessionBean.account.lastName} "/>
                <h:outputLabel style="color:gray;" value="Account E'mail : ">
                    <h:outputLabel style="color:black;" value="#{contactInformation.profileMail}"/>
                </h:outputLabel>
                <h:panelGrid columns="3">
                    <a4j:commandLink value="#{myContactBean.existModuleContact ? 'Edit':'Add'}"
                                       action="#{myContactBean.prepareToAddContactCard}"
                                       reRender="contactModalPanel"
                                       oncomplete="Richfaces.showModalPanel('contactModalPanel');"
                                       limitToList="true"
                            />
                    <h:outputLabel rendered="#{myContactBean.existModuleContact}" value="|"
                                   style="margin:2px; color:gray;"/>
                    <a4j:commandLink rendered="#{myContactBean.existModuleContact}"
                                       value="Delete"
                                       action="#{myContactBean.prepareToDeleteContact}"
                                       reRender="myContactConfirmModalPanel"
                                       oncomplete="Richfaces.showModalPanel('myContactConfirmModalPanel');"
                                       limitToList="true"/>
                </h:panelGrid>
                <!--<h:panelGroup rendered="#{myContactBean.existModuleContact}"-->
                <!--style="float:right; vertical-align:top;">-->
                <!--<contact:contactView requestBean="#{myContactBean}" id="my"/>-->
                <!--</h:panelGroup>-->
                <rich:panel id="myContactPanelNotExist"
                            rendered="#{not myContactBean.existModuleContact}"
                            bodyClass="rich-laguna-panel-no-header"
                            style="width:300px; height:100px;text-align:left;">
                    <h:panelGroup style="margin-top:20px;" layout="block">
                        <h:panelGrid columns="1">
                            <h:outputLabel value="You havn't create contat's card yet? ">
                                <a4j:commandLink value="Add"
                                               action="#{myContactBean.prepareToAddContactCard}"
                                               reRender="contactModalPanel"
                                               oncomplete="Richfaces.showModalPanel('contactModalPanel');"
                                               limitToList="true"
                                    />
                            </h:outputLabel>
                            <h:outputLabel value="After succes creating contact's card you will be able to add, and view other people contact's"/>

                        </h:panelGrid>
                    </h:panelGroup>
                </rich:panel>


                <rich:panel id="myContactPanel"
                            rendered="#{myContactBean.existModuleContact}"
                            bodyClass="rich-laguna-panel-no-header"
                            style="width:100%; overflow:auto; min-height:150px; height:auto">

                    <h:panelGroup layout="block"
                                  style="float:left;vertical-align:top; text-align:left; margin-right:20px">
                        <contact:mailView canEdit="true" bean="#{myContactBean}" id="myContactMailTelephone"/>
                    </h:panelGroup>
                    <h:panelGroup layout="block" style="float:right; vertical-align:top; text-align:left;">
                        <contact:addressView canEdit="true" bean="#{myContactBean}" id="myContactAddress"/>
                    </h:panelGroup>
                </rich:panel>
            </h:panelGrid>

        </h:panelGroup>
    </h:panelGroup>

    <!--<h:panelGroup style="float:left;">-->

    <!--</h:panelGroup>-->

    <!--</h:panelGrid>-->


    <!--</h:form>-->

</ui:component>


</html>
